Skip to content

[clr-interp] Async Resume stubs are exclusive to the JIT as they use a set of intrinsics that are JIT specific#123046

Merged
davidwrighton merged 4 commits intodotnet:mainfrom
davidwrighton:fix_asyncresumestubs_on_interpmode2
Jan 13, 2026
Merged

[clr-interp] Async Resume stubs are exclusive to the JIT as they use a set of intrinsics that are JIT specific#123046
davidwrighton merged 4 commits intodotnet:mainfrom
davidwrighton:fix_asyncresumestubs_on_interpmode2

Conversation

@davidwrighton
Copy link
Member

@davidwrighton davidwrighton commented Jan 9, 2026

- Disable running the interpreter compiler for these. In real scenarios we will either have a JIT to generate them, or they will be produced by the R2R compiler, so this should be a good long term solution
Implement the second half of the intrinsic for SetNextCallAsyncContinuation. This allows the interpreter to correctly generate code for async resumption stubs (although it won't use them itself, as the interpreter has a different path for calling async resume stubs that we don't currently plan to remove. This is used in some of our interpreter test modes where the runtime may choose to JIT a runtime async method and interpret its associated async resumption stub.

…a set of intrinsics that are JIT specific

- Disable running the interpreter compiler for these. In real scenarios we will either have a JIT to generate them, or they will be produced by the R2R compiler, so this should be a good long term solution
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @BrzVlad, @janvorli, @kg
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents the interpreter from attempting to compile async resume stubs, which use JIT-specific intrinsics that the interpreter cannot handle. The fix ensures that these stubs will be generated either by the JIT or R2R compiler.

  • Adds a new IsAsyncResumeStub() method to check if a dynamic method is an async resume stub
  • Updates the interpreter loading condition to skip async resume stubs

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/coreclr/vm/method.hpp Adds IsAsyncResumeStub() helper method to DynamicMethodDesc class, following the same pattern as other stub type checking methods
src/coreclr/vm/jitinterface.cpp Modifies interpreter loading condition in UnsafeJitFunction to exclude async resume stubs from interpreter compilation

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
jkotas
jkotas previously approved these changes Jan 10, 2026
@jkotas jkotas self-requested a review January 12, 2026 14:24
@davidwrighton davidwrighton dismissed jkotas’s stale review January 12, 2026 22:16

The change is now materially different

Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@davidwrighton davidwrighton merged commit 0f28558 into dotnet:main Jan 13, 2026
97 of 99 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants